package com.itheima.project.face.impl;

import com.itheima.project.adapter.CreditPayAdapter;
import com.itheima.project.exception.ProjectException;
import com.itheima.project.face.CreditPayFace;
import com.itheima.project.vo.trade.TradingVo;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName CreditPayFaceImpl.java
 * @Description 信用支付方式：免单、挂账
 */
@Slf4j
@Component
public class CreditPayFaceImpl implements CreditPayFace {

    @Autowired
    CreditPayAdapter creditPayAdapter;

    @Override
    @Transactional
    public TradingVo createCreditMdTrading(TradingVo tradingVo) throws ProjectException {
        return creditPayAdapter.createCreditMdTrading(tradingVo);
    }

    @Override
    @Transactional
    public TradingVo createCreditGzTrading(TradingVo tradingVo) throws ProjectException {
        return creditPayAdapter.createCreditGzTrading(tradingVo);
    }
}
